<!DOCTYPE html>
<html>
<head>
	<title><?=$title?></title>
	<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700&amp;subset=latin,cyrillic' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" type="text/css" href="<?=base_url()?>templ/<?=getTemplate()?>/css/main.css" />
	<link rel="icon" href="<?=base_url()?>favicon.ico" type="image/x-icon">
	<link rel="shortcut icon" href="<?=base_url()?>favicon.ico" type="image/x-icon">
<? if (!empty($description)):?>
	<meta name="description" content="<?=strip_tags($description)?>">
<? endif; ?>
<? if (!empty($og_image)):?>
	<meta name="og:image" content="<?=$og_image?>">
<? endif; ?>
	<script type="text/javascript" src="<?=base_url()?>link/js_vars"></script>
	<script type="text/javascript" src="<?=base_url()?>js/jquery.js"></script>
	<script type="text/javascript" src="<?=base_url()?>js/md5.js"></script>
	<script type="text/javascript" src="<?=base_url()?>js/main.js"></script>
<? if (!empty($addJS) && is_array($addJS)) { foreach ($addJS as $JS): ?>
	<script type="text/javascript" src="<?=$JS?>"></script>
<? endforeach; } ?>
<? if (!empty($addCSS) && is_array($addCSS)) { foreach ($addCSS as $CSS): ?>
	<link rel="stylesheet" type="text/css" href="<?=$CSS?>" />
<? endforeach; } ?>
</head>
<body>
<center>
	<div id="mainDiv">
		<div id="topDiv">
			<div id="headDiv">
				<?=(isset($headContent))?$headContent:" ";?>
				<div id="searchDiv">
					<input type="text" value="<?=isset($searchText) ? $searchText : ''?>" id="searchInput"/>
					<span id="searchSubmit"></span>
					<br>
					<span>Например, <a href="<?=base_url()?>search/Lorem%20ipsum">Lorem ipsum</a></span>
				</div>
			</div>
			<div id="menuDiv">
				<? if (isset($mainMenu) && is_array($mainMenu)):
					foreach ($mainMenu as $menu):
				?> <a href="<?=base_url().$menu->pUrl?>" class="menuLink<?=($menu->pUrl == $activePage)?' activeMenuLink':''?>"><?=$menu->pName?></a> <?
					endforeach;
					endif;
				?>
			</div>

			<? if (!empty($subMenu)):?>
			<div id="subMenuDiv">
			<? foreach ($subMenu as $sVal): ?>
				<a href="<?=base_url().$sVal->pUrl?>"><?=$sVal->pName?></a>
			<? endforeach; ?>
			</div>
			<? endif; ?>
			<?=$this->load->view('login_block', null, true)?>
		</div>
		<div id="middleDiv">
			<div id="contentDiv">
				<? if ($this->session->flashdata('message')): ?>
					<div class="messageDiv"><?=($this->session->flashdata('message'))?></div>
				<? endif; ?>
				<?=(isset($content))?$content:" ";?>
			</div>
			<div id="rightDiv">
				<?=(isset($rightContent))?$rightContent:" ";?>
			</div>
			<div style="clear:both"></div>
		</div>
		<div id="bottomDiv">
			<?=(isset($bottomContent))?$bottomContent:" ";?>
		</div>
	</div>
</center>
</body>
</html>